package TimeToWork.Android;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

public class NotificationAlarm {

    public static enum Type {GO_HOME, CHECK_IN;}


	public static void create(Context context, long when, Type type) {
		
	    AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
        Intent notificationIntent = new Intent(context, NotificationAlarmReciever.class);
        notificationIntent.putExtra("type", type.ordinal());
        PendingIntent contentIntent = PendingIntent.getBroadcast(context, 0, notificationIntent, PendingIntent.FLAG_ONE_SHOT);
	    
        alarmManager.set(AlarmManager.RTC_WAKEUP, when, contentIntent);
	}
}
